
#include "towerfactory.h"
#include "camp.h"
#include "rallypoint.h"
#include "mine.h"

TowerFactory::TowerFactory()
{
}

TowerFactory::~TowerFactory() {
}

Tower* TowerFactory::createTower(TowerType type, int x, int y) 
{
	Tower* tower = nullptr;

	switch(type) {
	case TowerType::castle:
		tower = new Camp(Point(x, y));
		break;
	case TowerType::rally_point:
		tower = new Flag(Point(x, y));
		break;
	case TowerType::mine:
		tower = new Mine(Point(x, y));
		break;
	default:break;
	}

	if(tower) {
		tower->init();
	}

	return tower;
}
